package com.mianyang.zhangsan.plugin.approval;

import com.mianyang.zhangsan.common.util.ExecuteUtils;
import com.mianyang.zhangsan.model.dto.SecApprovalDto;
import com.mianyang.zhangsan.service.ISecSpringContextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author jiangjr
 * @date 2022-10-25
 */
@Component
public class ApprovalAdaptor {
    @Autowired
    private ISecSpringContextService springContextService;

    public void adaptor(String type, SecApprovalDto dto) {
        Object instance = springContextService.getBean(type);
        ExecuteUtils.invoke(instance, "handle", new Class[]{SecApprovalDto.class}, dto);
    }
}
